class Solution(object):
    def isAnagram(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: bool
        """
        if len(s) != len(t):
            return False

        for c in s:
          t = t.replace(c, '', 1)

        return t == ''
        
s = Solution()
print(s.isAnagram("anagram", "nagaram")) # t